home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / vbdatabs / placenew.h < prev    next >
C/C++ Source or Header  |  1999-03-14  |  2KB  |  54 lines

  1. // ------------------------------- //
  2. // -------- Start of File -------- //
  3. // ------------------------------- //
  4. // ----------------------------------------------------------- //
  5. // C++ Header File Name: placenew.h 
  6. // Compiler Used: MSVC40, DJGPP 2.7.2.1, GCC 2.7.2.1, HP CPP 10.24
  7. // Produced By: Doug Gaer    
  8. // File Creation Date: 02/28/1997 
  9. // Date Last Modified: 03/15/1999
  10. // Copyright (c) 1997 Douglas M. Gaer
  11. // ----------------------------------------------------------- // 
  12. // ---------- Include File Description and Details  ---------- // 
  13. // ----------------------------------------------------------- // 
  14. /*
  15. The VBD C++ classes are copyright (c) 1997, by Douglas M. Gaer.
  16. All those who put this code or its derivatives in a commercial
  17. product MUST mention this copyright in their documentation for
  18. users of the products in which this code or its derivative
  19. classes are used. Otherwise, you have the freedom to redistribute
  20. verbatim copies of this source code, adapt it to your specific
  21. needs, or improve the code and release your improvements to the
  22. public provided that the modified files carry prominent notices
  23. stating that you changed the files and the date of any change.
  24.  
  25. THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND.
  26. THE ENTIRE RISK OF THE QUALITY AND PERFORMANCE OF THIS SOFTWARE
  27. IS WITH YOU. SHOULD ANY ELEMENT OF THIS SOFTWARE PROVE DEFECTIVE,
  28. YOU WILL ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR
  29. CORRECTION.
  30.  
  31. This overloaded new operator is used to place a new object at
  32. a user defined address (in-place construction). The compiler
  33. will insert the constructor call when it sees the new operator.
  34. The address of the object passed to the constructor (the this
  35. pointer) is returned by the new operator. NOTE: The size_t
  36. parameter is required by C++ syntax, but is not need because
  37. this function assumes that the proper space already has been 
  38. allocated. 
  39. */
  40. // ----------------------------------------------------------- //   
  41. #ifndef __PLACENEW_HPP
  42. #define __PLACENEW_HPP
  43.  
  44. inline void *operator new(size_t, void *ptr) 
  45.   return ptr; // Return the same address passed in
  46. }
  47.  
  48. #endif // __PLACENEW_HPP
  49. // ----------------------------------------------------------- // 
  50. // ------------------------------- //
  51. // --------- End of File --------- //
  52. // ------------------------------- //
  53.